package com.woniuxy.sd.action;

import java.io.File;

import org.apache.struts2.ServletActionContext;

public class FileListAction {
	
	private String[] fileList;
	
	public String[] getFileList() {
		return fileList;
	}

	public void setFileList(String[] fileList) {
		this.fileList = fileList;
	}

	public String execute(){
		String path = ServletActionContext.getServletContext().getRealPath("/file");
		System.out.println(ServletActionContext.getServletContext().getRealPath(""));
		File file = new File(path);
		fileList = file.list();
		
		for(String fn : fileList){
			System.out.println(fn);
		}
		
		return "filePage";
	}

}
